package com.yongcheon.starhealthcare.friend.fragment;

import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.yongcheon.starhealthcare.R;

import java.util.Locale;

/**
 * Created by yongcheon on 2015-02-06.
 */
public class Friend_FragmentPagerAdapter extends FragmentPagerAdapter {
    Context mContext;

    public Friend_FragmentPagerAdapter(Context mContext, FragmentManager fm) {
        super(fm);
        this.mContext = mContext;
    }

    @Override
    public Fragment getItem(int position) {
        switch (position) {
            case 0:
                return new NewsFeedFragment();
            case 1:
                return new FriendsFragment();
        }
        return null;
    }

    @Override
    public int getCount() {
        return 2;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        Locale l = Locale.getDefault();
        switch (position) {
            case 0:
                return mContext.getResources().getString(R.string.news_feed).toUpperCase(l);
            case 1:
                return mContext.getResources().getString(R.string.friends).toUpperCase(l);
        }
        return null;
    }
}
